<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MTB CAT1 Peripheral driver library: Functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="IFXCYP_one-line.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MTB CAT1 Peripheral driver library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__group__crypto__lld__rng__functions.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Functions<div class="ingroups"><a class="el" href="group__group__crypto.html">Crypto       (Cryptography)</a> &raquo; <a class="el" href="group__group__crypto__lld__api.html">Direct Crypto Core Access</a> &raquo; <a class="el" href="group__group__crypto__lld__rng.html">Random Number Generation (TRNG, PRNG)</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga2ed2909fd8b7fe5cba913e3154759b89"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE <a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__lld__rng__functions.html#ga2ed2909fd8b7fe5cba913e3154759b89">Cy_Crypto_Core_Prng_Init</a> (CRYPTO_Type *base, uint32_t lfsr32InitState, uint32_t lfsr31InitState, uint32_t lfsr29InitState)</td></tr>
<tr class="memdesc:ga2ed2909fd8b7fe5cba913e3154759b89"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes the PRND parameters.  <a href="#ga2ed2909fd8b7fe5cba913e3154759b89">More...</a><br /></td></tr>
<tr class="separator:ga2ed2909fd8b7fe5cba913e3154759b89"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga612915c3ba5d4148960c2454e9418d55"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE <a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__lld__rng__functions.html#ga612915c3ba5d4148960c2454e9418d55">Cy_Crypto_Core_Prng</a> (CRYPTO_Type *base, uint32_t max, uint32_t *randomNum)</td></tr>
<tr class="memdesc:ga612915c3ba5d4148960c2454e9418d55"><td class="mdescLeft">&#160;</td><td class="mdescRight">Generates a Pseudo Random Number.  <a href="#ga612915c3ba5d4148960c2454e9418d55">More...</a><br /></td></tr>
<tr class="separator:ga612915c3ba5d4148960c2454e9418d55"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga932cb553e263239ea301064704224042"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__lld__rng__functions.html#ga932cb553e263239ea301064704224042">Cy_Crypto_Core_Trng_Init</a> (CRYPTO_Type *base, <a class="el" href="structcy__stc__crypto__trng__config__t.html">cy_stc_crypto_trng_config_t</a> *config)</td></tr>
<tr class="memdesc:ga932cb553e263239ea301064704224042"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the TRNG hardware submodule.  <a href="#ga932cb553e263239ea301064704224042">More...</a><br /></td></tr>
<tr class="separator:ga932cb553e263239ea301064704224042"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8af6d05b8e2805a2228e263f4f4f4bf8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__lld__rng__functions.html#ga8af6d05b8e2805a2228e263f4f4f4bf8">Cy_Crypto_Core_Trng_DeInit</a> (CRYPTO_Type *base)</td></tr>
<tr class="memdesc:ga8af6d05b8e2805a2228e263f4f4f4bf8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clears all TRNG registers by setting it to hardware default values.  <a href="#ga8af6d05b8e2805a2228e263f4f4f4bf8">More...</a><br /></td></tr>
<tr class="separator:ga8af6d05b8e2805a2228e263f4f4f4bf8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0656d4596d1f6ddc7babd8a716176bc8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__lld__rng__functions.html#ga0656d4596d1f6ddc7babd8a716176bc8">Cy_Crypto_Core_Trng_Start</a> (CRYPTO_Type *base, uint32_t dataSize)</td></tr>
<tr class="memdesc:ga0656d4596d1f6ddc7babd8a716176bc8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Starts a random number generation.  <a href="#ga0656d4596d1f6ddc7babd8a716176bc8">More...</a><br /></td></tr>
<tr class="separator:ga0656d4596d1f6ddc7babd8a716176bc8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga72a81a52665ed7404d9c4e3ed3036b80"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__lld__rng__functions.html#ga72a81a52665ed7404d9c4e3ed3036b80">Cy_Crypto_Core_Trng_ReadData</a> (CRYPTO_Type *base, uint32_t *randomData)</td></tr>
<tr class="memdesc:ga72a81a52665ed7404d9c4e3ed3036b80"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads in blocking mode a generated random number.  <a href="#ga72a81a52665ed7404d9c4e3ed3036b80">More...</a><br /></td></tr>
<tr class="separator:ga72a81a52665ed7404d9c4e3ed3036b80"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab80f93878b181bb72bc0adf31b7eda15"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__lld__rng__functions.html#gab80f93878b181bb72bc0adf31b7eda15">Cy_Crypto_Core_Trng</a> (CRYPTO_Type *base, uint32_t GAROPol, uint32_t FIROPol, uint32_t max, uint32_t *randomNum)</td></tr>
<tr class="memdesc:gab80f93878b181bb72bc0adf31b7eda15"><td class="mdescLeft">&#160;</td><td class="mdescRight">Generates a True Random Number.  <a href="#gab80f93878b181bb72bc0adf31b7eda15">More...</a><br /></td></tr>
<tr class="separator:gab80f93878b181bb72bc0adf31b7eda15"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3d4fac6e5391fa6a5b20f29f49ac24b8"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE <a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__crypto__lld__rng__functions.html#ga3d4fac6e5391fa6a5b20f29f49ac24b8">Cy_Crypto_Core_Trng_Ext</a> (CRYPTO_Type *base, uint32_t max, uint32_t *randomNum)</td></tr>
<tr class="memdesc:ga3d4fac6e5391fa6a5b20f29f49ac24b8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Generates a True Random Number.  <a href="#ga3d4fac6e5391fa6a5b20f29f49ac24b8">More...</a><br /></td></tr>
<tr class="separator:ga3d4fac6e5391fa6a5b20f29f49ac24b8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga2ed2909fd8b7fe5cba913e3154759b89"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2ed2909fd8b7fe5cba913e3154759b89">&#9670;&nbsp;</a></span>Cy_Crypto_Core_Prng_Init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE <a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> Cy_Crypto_Core_Prng_Init </td>
          <td>(</td>
          <td class="paramtype">CRYPTO_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>lfsr32InitState</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>lfsr31InitState</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>lfsr29InitState</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initializes the PRND parameters. </p>
<p>Invoking this function causes a restart of the pseudo-random sequence.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to the CRYPTO instance.</td></tr>
    <tr><td class="paramname">lfsr32InitState</td><td>A non-zero seed value for the first LFSR.</td></tr>
    <tr><td class="paramname">lfsr31InitState</td><td>A non-zero seed value for the second LFSR.</td></tr>
    <tr><td class="paramname">lfsr29InitState</td><td>A non-zero seed value for the third LFSR.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a></dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line"></div><div class="line">    <span class="comment">/* Initialization seed values for Pseudo Random Generator */</span></div><div class="line"><span class="preprocessor">    #define LFSR32_INITSTATE      (0xd8959bc9)</span></div><div class="line"><span class="preprocessor">    #define LFSR31_INITSTATE      (0x2bb911f8)</span></div><div class="line"><span class="preprocessor">    #define LFSR29_INITSTATE      (0x060c31b7)</span></div><div class="line"></div><div class="line"><span class="preprocessor">    #define MAX_PRNG_VALUE        (255UL)</span></div><div class="line"></div><div class="line">    <span class="comment">/* Generated Random Number */</span></div><div class="line">    uint32_t rndNum = 0;</div><div class="line"></div><div class="line">    <a class="code" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> cryptoStatus;</div><div class="line"></div><div class="line">    <span class="comment">/* Initialize Pseudo Random Generator */</span></div><div class="line">    cryptoStatus = <a class="code" href="group__group__crypto__lld__rng__functions.html#ga2ed2909fd8b7fe5cba913e3154759b89">Cy_Crypto_Core_Prng_Init</a>(</div><div class="line">                             CRYPTO_HW,         <span class="comment">/* Pointer to Crypto instance */</span></div><div class="line">                             LFSR32_INITSTATE,   <span class="comment">/* Seed value for first LFSR */</span></div><div class="line">                             LFSR31_INITSTATE,  <span class="comment">/* Seed value for second LFSR */</span></div><div class="line">                             LFSR29_INITSTATE);  <span class="comment">/* Seed value for third LFSR */</span></div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    <span class="comment">/* Generate a Pseudo Random number in specified range */</span></div><div class="line">    cryptoStatus = <a class="code" href="group__group__crypto__lld__rng__functions.html#ga612915c3ba5d4148960c2454e9418d55">Cy_Crypto_Core_Prng</a>(</div><div class="line">                             CRYPTO_HW,</div><div class="line">                             MAX_PRNG_VALUE,       <span class="comment">/* Range of random number */</span></div><div class="line">                             &amp;rndNum); <span class="comment">/* Pointer to generated random number */</span></div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="ga612915c3ba5d4148960c2454e9418d55"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga612915c3ba5d4148960c2454e9418d55">&#9670;&nbsp;</a></span>Cy_Crypto_Core_Prng()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE <a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> Cy_Crypto_Core_Prng </td>
          <td>(</td>
          <td class="paramtype">CRYPTO_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>max</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>randomNum</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Generates a Pseudo Random Number. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to the CRYPTO instance.</td></tr>
    <tr><td class="paramname">max</td><td>The maximum value of a random number.</td></tr>
    <tr><td class="paramname">randomNum</td><td>The pointer to a variable to store the generated pseudo random number.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a></dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line"></div><div class="line">    <span class="comment">/* Initialization seed values for Pseudo Random Generator */</span></div><div class="line"><span class="preprocessor">    #define LFSR32_INITSTATE      (0xd8959bc9)</span></div><div class="line"><span class="preprocessor">    #define LFSR31_INITSTATE      (0x2bb911f8)</span></div><div class="line"><span class="preprocessor">    #define LFSR29_INITSTATE      (0x060c31b7)</span></div><div class="line"></div><div class="line"><span class="preprocessor">    #define MAX_PRNG_VALUE        (255UL)</span></div><div class="line"></div><div class="line">    <span class="comment">/* Generated Random Number */</span></div><div class="line">    uint32_t rndNum = 0;</div><div class="line"></div><div class="line">    <a class="code" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> cryptoStatus;</div><div class="line"></div><div class="line">    <span class="comment">/* Initialize Pseudo Random Generator */</span></div><div class="line">    cryptoStatus = <a class="code" href="group__group__crypto__lld__rng__functions.html#ga2ed2909fd8b7fe5cba913e3154759b89">Cy_Crypto_Core_Prng_Init</a>(</div><div class="line">                             CRYPTO_HW,         <span class="comment">/* Pointer to Crypto instance */</span></div><div class="line">                             LFSR32_INITSTATE,   <span class="comment">/* Seed value for first LFSR */</span></div><div class="line">                             LFSR31_INITSTATE,  <span class="comment">/* Seed value for second LFSR */</span></div><div class="line">                             LFSR29_INITSTATE);  <span class="comment">/* Seed value for third LFSR */</span></div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    <span class="comment">/* Generate a Pseudo Random number in specified range */</span></div><div class="line">    cryptoStatus = <a class="code" href="group__group__crypto__lld__rng__functions.html#ga612915c3ba5d4148960c2454e9418d55">Cy_Crypto_Core_Prng</a>(</div><div class="line">                             CRYPTO_HW,</div><div class="line">                             MAX_PRNG_VALUE,       <span class="comment">/* Range of random number */</span></div><div class="line">                             &amp;rndNum); <span class="comment">/* Pointer to generated random number */</span></div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="ga932cb553e263239ea301064704224042"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga932cb553e263239ea301064704224042">&#9670;&nbsp;</a></span>Cy_Crypto_Core_Trng_Init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cy_Crypto_Core_Trng_Init </td>
          <td>(</td>
          <td class="paramtype">CRYPTO_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__crypto__trng__config__t.html">cy_stc_crypto_trng_config_t</a> *&#160;</td>
          <td class="paramname"><em>config</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize the TRNG hardware submodule. </p>
<dl class="section pre"><dt>Precondition</dt><dd>If the TRNG submodule is initialized previously, the <a class="el" href="group__group__crypto__lld__rng__functions.html#ga8af6d05b8e2805a2228e263f4f4f4bf8">Cy_Crypto_Core_Trng_DeInit()</a> must be called before calling this function.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to the CRYPTO instance.</td></tr>
    <tr><td class="paramname">config</td><td>The pointer to the configuration structure. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga8af6d05b8e2805a2228e263f4f4f4bf8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8af6d05b8e2805a2228e263f4f4f4bf8">&#9670;&nbsp;</a></span>Cy_Crypto_Core_Trng_DeInit()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cy_Crypto_Core_Trng_DeInit </td>
          <td>(</td>
          <td class="paramtype">CRYPTO_Type *&#160;</td>
          <td class="paramname"><em>base</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Clears all TRNG registers by setting it to hardware default values. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to the CRYPTO instance.</td></tr>
  </table>
  </dd>
</dl>
<p>Clears all TRNG registers by setting it to hardware default values.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to the CRYPTO instance. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga0656d4596d1f6ddc7babd8a716176bc8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0656d4596d1f6ddc7babd8a716176bc8">&#9670;&nbsp;</a></span>Cy_Crypto_Core_Trng_Start()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> Cy_Crypto_Core_Trng_Start </td>
          <td>(</td>
          <td class="paramtype">CRYPTO_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>dataSize</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Starts a random number generation. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to the CRYPTO instance.</td></tr>
    <tr><td class="paramname">dataSize</td><td>The maximum length of a random number, in the range [0, 32] bits.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The error / status code. See <a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>. </dd></dl>

</div>
</div>
<a id="ga72a81a52665ed7404d9c4e3ed3036b80"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga72a81a52665ed7404d9c4e3ed3036b80">&#9670;&nbsp;</a></span>Cy_Crypto_Core_Trng_ReadData()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> Cy_Crypto_Core_Trng_ReadData </td>
          <td>(</td>
          <td class="paramtype">CRYPTO_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>randomData</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Reads in blocking mode a generated random number. </p>
<dl class="section note"><dt>Note</dt><dd>Call this API only after <a class="el" href="group__group__crypto__lld__rng__functions.html#ga0656d4596d1f6ddc7babd8a716176bc8" title="Starts a random number generation. ">Cy_Crypto_Core_Trng_Start()</a> is successful.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to the CRYPTO instance.</td></tr>
    <tr><td class="paramname">randomData</td><td>The pointer to a generated true random number. Must be 4-byte aligned.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The error / status code. See <a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a>. </dd></dl>

</div>
</div>
<a id="gab80f93878b181bb72bc0adf31b7eda15"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab80f93878b181bb72bc0adf31b7eda15">&#9670;&nbsp;</a></span>Cy_Crypto_Core_Trng()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> Cy_Crypto_Core_Trng </td>
          <td>(</td>
          <td class="paramtype">CRYPTO_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>GAROPol</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>FIROPol</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>max</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>randomNum</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Generates a True Random Number. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to the CRYPTO instance.</td></tr>
    <tr><td class="paramname">GAROPol</td><td>The polynomial for the programmable Galois ring oscillator.</td></tr>
    <tr><td class="paramname">FIROPol</td><td>The polynomial for the programmable Fibonacci ring oscillator.</td></tr>
    <tr><td class="paramname">max</td><td>The maximum length of a random number, in the range of [0, 32] bits.</td></tr>
    <tr><td class="paramname">randomNum</td><td>The pointer to a generated true random number. Must be 4-byte aligned.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a></dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to the CRYPTO instance.</td></tr>
    <tr><td class="paramname">GAROPol</td><td>The polynomial for the programmable Galois ring oscillator.</td></tr>
    <tr><td class="paramname">FIROPol</td><td>The polynomial for the programmable Fibonacci ring oscillator.</td></tr>
    <tr><td class="paramname">max</td><td>The maximum length of a random number, in the range of [0, 32] bits.</td></tr>
    <tr><td class="paramname">randomNum</td><td>The pointer to a generated true random number. Must be 4-byte aligned.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a></dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line"></div><div class="line">    <span class="comment">/* Initialization polynomial values for True Random Generator.</span></div><div class="line"><span class="comment"></span></div><div class="line"><span class="comment">        Polynomial for programmable Galois ring oscillator.</span></div><div class="line"><span class="comment">        The polynomial is represented WITHOUT the high order bit (this bit is always assumed &#39;1&#39;).</span></div><div class="line"><span class="comment"></span></div><div class="line"><span class="comment">        GARO 31 bit polynomial (0x04c1:1db7) = x31 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 + x + 1</span></div><div class="line"><span class="comment"></span></div><div class="line"><span class="comment">        Polynomial for programmable Fibonacci ring oscillator.</span></div><div class="line"><span class="comment">        The polynomial is represented WITHOUT the high order bit (this bit is always assumed &#39;1&#39;).</span></div><div class="line"><span class="comment"></span></div><div class="line"><span class="comment">        FIRO 31 bit polynomial (0x04c1:1db7) = x31 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 + x + 1</span></div><div class="line"><span class="comment">    */</span></div><div class="line"><span class="preprocessor">    #define GARO31_INITSTATE      (0x04c11db7)</span></div><div class="line"><span class="preprocessor">    #define FIRO31_INITSTATE      (0x04c11db7)</span></div><div class="line"></div><div class="line"><span class="preprocessor">    #define MAX_TRNG_BIT_SIZE     (32UL)</span></div><div class="line"></div><div class="line">    <span class="comment">/* Generated Random Number */</span></div><div class="line">    uint32_t rndNum = 0;</div><div class="line"></div><div class="line">    <a class="code" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> cryptoStatus;</div><div class="line"></div><div class="line">    <span class="comment">/* Generate True Random number in a specified range */</span></div><div class="line">    cryptoStatus = <a class="code" href="group__group__crypto__lld__rng__functions.html#gab80f93878b181bb72bc0adf31b7eda15">Cy_Crypto_Core_Trng</a>(</div><div class="line">                             CRYPTO_HW,         <span class="comment">/* Pointer to Crypto instance */</span></div><div class="line">                             GARO31_INITSTATE, <span class="comment">/* Polynomial for programmable GARO */</span></div><div class="line">                             FIRO31_INITSTATE, <span class="comment">/* Polynomial for programmable FIRO */</span></div><div class="line">                             MAX_TRNG_BIT_SIZE,     <span class="comment">/* Range of random number */</span></div><div class="line">                             &amp;rndNum);  <span class="comment">/* Pointer to generated random number */</span></div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="ga3d4fac6e5391fa6a5b20f29f49ac24b8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3d4fac6e5391fa6a5b20f29f49ac24b8">&#9670;&nbsp;</a></span>Cy_Crypto_Core_Trng_Ext()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE <a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> Cy_Crypto_Core_Trng_Ext </td>
          <td>(</td>
          <td class="paramtype">CRYPTO_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>max</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>randomNum</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Generates a True Random Number. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to the CRYPTO instance.</td></tr>
    <tr><td class="paramname">max</td><td>The maximum length of a random number, in the range of [0, 32] bits.</td></tr>
    <tr><td class="paramname">randomNum</td><td>The pointer to a generated true random number. Must be 4-byte aligned.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__crypto__enums.html#ga3a65158da3dc5cb6aa016ae599542aad">cy_en_crypto_status_t</a> </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>MTB CAT1 Peripheral driver library</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
